<?php $this->context->layout = 'form';?>

<form class="form-horizontal m" id="form-admin-edit">
    <?= \common\widgets\FormInput::widget(['name'=>'forminput|名称','extend'=>['name'=>'name','required'=>1]])?>
    <?= \common\widgets\FormInput::widget(['name'=>'image|图片','extend'=>['link'=>'false','name'=>'imgarr1','id'=>'uploadimgbtn1','script_after'=>'1','cat'=>'bmimage','water'=>'true','sm'=>3]])?>
    <input type="hidden" name="icon" id="img1" value="">
    <?= \common\widgets\FormInput::widget(['name'=>'forminput|排序','extend'=>['name'=>'sort','required'=>1,'value'=>0,'tips'=>'值越大越靠前']])?>
    <?= \common\widgets\FormInput::widget(['name'=>'formradio|状态','extend'=>['name'=>'status','required'=>1,'value'=>1]])?>
</form>

<?php $this->beginBlock('script'); ?>
<script>
    function submitHandler() {
        if ($.validate.form()) {
            imgassign("input[name='imgarr1[]']",'#img1')
            $.operate.save(oasUrl, $('#form-admin-edit').serialize());
        }
    }
</script>
<?php $this->endBlock(); ?>
